package com.hbnu.system.core.util;

import com.baomidou.mybatisplus.core.metadata.IPage;
import com.baomidou.mybatisplus.extension.plugins.pagination.Page;

/**
 * @Author: cyj
 * @DateTime: 2021/8/3 17:04
 **/
public class PageUtil {

    public static <T> IPage<T> getPage(Integer pageNum, Integer pageSize) {
        return new Page<T>(pageNum, pageSize);
    }

    /**
     * 是否开启count模式，选择false 需要手动设置total数量
     */
    public static <T> IPage<T> getPage(Integer pageNum, Integer pageSize, boolean isSearchCount) {
        Page<T> page = new Page<>(pageNum, pageSize);
        page.setSearchCount(isSearchCount);
        return page;
    }
}
